package net.zoneland.knowledge.service;

import java.util.List;

import com.branchitech.gum.domain.Organization;

import net.zoneland.knowledge.exceptions.UserServiceException;
import net.zoneland.knowledge.model.LoginUserPojo;

/**
 * 用户相关.
 *
 * @author: bcc
 *     2022/3/7
 */
public interface UserService {

    /**
     * 根据用户ID获取用户信息.
     * @param uid
     * @return
     */
    LoginUserPojo getUserByUid(final String uid) throws Exception;

    /**
     * 获取cityId
     * @param userPojo
     * @return
     */
    String getCityId(final LoginUserPojo userPojo) ;

    /**
     * 查询公司列表.
     * @param includeCommon 是否包含通用
     * @return
     */
    List<Organization> queryBranchCompList(boolean includeCommon) throws UserServiceException;

    /**
     * 获取部门列表.
     * @param companyCode
     * @return
     */
    List<Organization> queryDeptByCompCode(final String companyCode) throws UserServiceException;

    /**
     * 判断人员是否存在.
     * @param userName
     * @param orgCode
     * @return
     */
    boolean checkUserExists(final String userName, final String orgCode) throws UserServiceException;

    /**
     * 根据code获取公司信息.
     * @param code
     * @return
     */
    Organization getCompanyByCode(String code) throws UserServiceException;

    /**
     * 根据公司名获取公司编码.
     * @param companyName
     * @return
     * @throws UserServiceException
     */
    Organization getCompanyByName(String companyName) throws UserServiceException;

    /**
     * 获取用户部门code及上级部门code
     * @param loginUserPojo
     * @return
     * @throws UserServiceException
     */
    List<String> getUserDeptCodeAndParentDeptCode(LoginUserPojo loginUserPojo) throws Exception;
}
